﻿using System;
using System.Data;
using VoteMS.BLL;
/*
 * @author zhu95
 */
namespace VoteMS.UI
{
    public partial class Default : System.Web.UI.Page
    {
        ProjectsBLL projectsBll = new ProjectsBLL();
        protected void Page_Load(object sender, EventArgs e)
        {

            DataSet ds = projectsBll.GetProjectByWhere("");
            gvProjects.DataSource = ds.Tables[0];
            gvProjects.DataBind();
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string strWhere = "";
            if (txtProjectName.Text.Trim() != "")
            {
                strWhere += " ProjectName like '%" + txtProjectName.Text + "%' ";
            }
            DataSet ds = projectsBll.GetProjectByWhere(strWhere);
            gvProjects.DataSource = ds.Tables[0];
            gvProjects.DataBind();
        }
        
    }
}